#include "MyDirect3DVertexBuffer7.h"
#include "MyDirect3DDevice7.h"

HRESULT STDMETHODCALLTYPE MyDirect3DVertexBuffer7::Optimize(LPDIRECT3DDEVICE7 lpD3DDevice, DWORD dwFlags) {
    DebugWrite("MyDirect3DVertexBuffer7::Optimize\n");
    MyDirect3DDevice7* device = (MyDirect3DDevice7*)lpD3DDevice;
    IDirect3DDevice7* orgDevice;
    device->GetOriginal(&orgDevice);
    return this->direct3DVertexBuffer7->Optimize(orgDevice, dwFlags);
}

HRESULT STDMETHODCALLTYPE MyDirect3DVertexBuffer7::ProcessVertices(DWORD dwVertexOp, DWORD dwDestIndex, DWORD dwCount, LPDIRECT3DVERTEXBUFFER7 lpSrcBuffer, DWORD dwSrcIndex, LPDIRECT3DDEVICE7 lpD3DDevice, DWORD dwFlags) {
    DebugWrite("MyDirect3DVertexBuffer7::ProcessVertices\n");
    MyDirect3DDevice7* device = (MyDirect3DDevice7*)lpD3DDevice;
    IDirect3DDevice7* orgDevice;
    device->GetOriginal(&orgDevice);
    MyDirect3DVertexBuffer7* buffer = (MyDirect3DVertexBuffer7*)lpSrcBuffer;
    IDirect3DVertexBuffer7* orgBuffer;
    buffer->GetOriginal(&orgBuffer);
    return this->direct3DVertexBuffer7->ProcessVertices(dwVertexOp, dwDestIndex, dwCount, orgBuffer, dwSrcIndex, orgDevice, dwFlags);
}

HRESULT STDMETHODCALLTYPE MyDirect3DVertexBuffer7::ProcessVerticesStrided(DWORD dwVertexOp, DWORD dwDestIndex, DWORD dwCount, LPD3DDRAWPRIMITIVESTRIDEDDATA lpVertexArray, DWORD dwSrcIndex, LPDIRECT3DDEVICE7 lpD3DDevice, DWORD dwFlags) {
    DebugWrite("MyDirect3DVertexBuffer7::ProcessVerticesStrided\n");
    MyDirect3DDevice7* device = (MyDirect3DDevice7*)lpD3DDevice;
    IDirect3DDevice7* orgDevice;
    device->GetOriginal(&orgDevice);
    return this->direct3DVertexBuffer7->ProcessVerticesStrided(dwVertexOp, dwDestIndex, dwCount, lpVertexArray, dwSrcIndex, orgDevice, dwFlags);
}